
score = 0
grades = {
}
print("输入班级同学的姓名和成绩")
print("enter ‘q’ when you are finished")

while True:
    name = input("姓名")
    grade = input("成绩")

    if name == 'q':
        break
    if grade == 'q':
        break
    grades[name] = grade

e = list(grades.values())
print(e)
grade_big = 0
for i in e[:len(grades)-1]:
    score += int(i)
print(score)
print(f"平均值是{score/(len(grades)-1)}")

high = e[0]
g = list(grades.keys())
num = 0
for j in e[:len(grades)-1]:
    if int(j) >= int(high):
        high = int(j)
        num = e.index(j)
print(f"first is {g[num]},{high}")



